// Written by Craig'n'Dave
using System;
// Linear search
namespace ConsoleApp1
{
    class Program
    {
        static void linear_search(string[] items, string item_to_find)
        {
            int index = 0;
            bool found = false;
            // Check every item until found or until there are no more items to check
            while ((!found) && (index < items.Length))
            {
                if (items[index] == item_to_find)
                {
                    found = true;
                }
                else
                {
                    index = index + 1;
                }
            }
            if (found)
            {
                Console.WriteLine("Item found at position " + index);
            }
            else
            {
                Console.WriteLine("Item not found");
            }
        }


        // Main program starts here
        static void Main(string[] args)
        {
            string[] items = { "Florida", "Georgia", "Delaware", "Alabama", "California" };
            Console.Write("Enter the state to find: ");
            string item_to_find = Console.ReadLine();
            linear_search(items, item_to_find);
        }
    }
}
